<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>用户登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="./public/js/jquery-1.7.2.js"></script>

<link href="./public/css/login.css" rel="stylesheet" type="text/css" />
<link href="./public/css/alertify.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<h1>
		新闻发布系统<sup>V2015</sup>
	</h1>
	<div class="login" style="margin-top: 50px;">
		<div class="web_qr_login" id="web_qr_login"
			style="display: block; height: 235px;">
			<div class="web_login" id="web_login">
				<div class="login-box">
					<div class="login_form">
						<form class="loginForm" onsubmit="return check();">
							<div class="uinArea" id="uinArea">
								<label class="input-tips" for="u">帐号：</label>
								<div class="inputOuter" id="uArea">
									<input type="text" id="username" name="username" class="inputstyle" />
								</div>
							</div>
							<div class="pwdArea" id="pwdArea">
								<label class="input-tips" for="p">密码：</label>
								<div class="inputOuter" id="pArea">
									<input type="password" id="password" name="password" class="inputstyle" />
								</div>
							</div>
							<div style="padding-left: 50px; margin-top: 20px;">
								<input type="submit" value="登 录" style="width: 150px;" class="button_blue" id="login-btn" />
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
</body>
<script type="text/javascript" src="./public/js/alertify.js"></script>
</html>
<script>
{literal}
$("#login-btn").click(function(){
    var username,password,company;
    username = $.trim($("#username").val());
    password = $.trim($("#password").val());
	if(username == ''){
		alertify.error("用户名不能为空!");
		$("#username").focus();
		return false;
	}
	if(password == ''){
		alertify.error("密码不能为空");
		$("#password").focus();
		return false;
	}
	$("#login-btn").val("登录中,请稍候...");
	$.post("index.php?mod=admin&act=adminLogin",{"username":username, "password":password},function(rtn){
		if(rtn.tip == "ok"){
			alertify.success("亲,登录成功！");
			setTimeout("location.href='index.php?mod=admin&act=getUserList'",1000);
		}else {
			$("#login-btn").val("登录");
			alertify.error("亲,登录失败！可能原因：<br/>1、请检查帐号密码是否输入正确！<br/>2、系统未授权你登录此系统！");        
		}
	},
	'json'
	);
});
function check(){
	return false;
}
{/literal}
</script>

